<template>
  <div class="fixedButton" @click="buttonClick">
    <div v-if="icon" class="icon iconfont" :class="icon"></div>
    <div v-if="title" class="title">{{title}}</div>
  </div>
</template>

<script>
export default {
  props: {
    title: {
      type: String,
      default: ''
    },
    icon: {
      type: String,
      default: ''
    }
  },
  methods: {
    buttonClick () {
      this.$emit('buttonClick', {
        title: this.title,
        icon: this.icon
      })
    }
  }
}
</script>

<style lang="scss" scoped>
  @import '~common/scss/color';

  .fixedButton {
    display: flex;
    align-items: center;
    border-radius: 6px;
    background-color: $color-default;
    color: white;
    padding: 8px 15px;
    > .icon {
      margin-right: 5px;
    }
    > .title {
      font-size: 14px;
    }
  }
</style>
